  <template>
  <div>
    <Headline
      :headline1="$t('m.AccessAdmin') + '  /  '"
      :headline2="$t('m.AccordingToThePeopleAuthorization')"
    />
    <a-card style="width: 100%">
      <!-- <select-tree-area @checkData="argumentSelect"> </select-tree-area> -->
      <select-tree @checkData="argumentSelect" />

      <a-select
        style="width: 100px; margin-right: 15px; margin-left: 15px"
        default-value="-1"
        @change="treeChangeA"
      >
        <a-select-option
          v-for="item in selectList"
          :key="item.code"
          :value="item.code"
        >
          {{ item.name }}
        </a-select-option>
      </a-select>
      <a-input-search
        v-model="forminitial.key"
        style="width: 200px; margin-right: 15px"
        :placeholder="$t('m.PleaseEnterYourSearchTerms')"
        enter-button
        @search="onSearch"
      />
      <a-checkbox @change="onCheck">
        {{ $t("m.WhetherToDisplayChildNodes") }}
      </a-checkbox>
      <a-table
        style="margin-top: 20px"
        :rowKey="(record, i) => i"
        :columns="Columns"
        :data-source="Data"
        :pagination="false"
        :row-selection="{
          onChange: onSelectChange,
          type: 'radio',
        }"
        bordered
      >
        <div slot="show" slot-scope="text, tags, i">
          <a @click="showItem(text, tags, i)"> {{ $t("m.Examine") }}</a>
        </div>
      </a-table>
      <a-pagination
        style="margin-top: 20px"
        show-size-changer
        :default-current="1"
        :total="total"
        @change="Pages"
        :pageSizeOptions="['5', '10', '30', '40']"
        @showSizeChange="onShowSizeChange"
        class="pages"
      />
    </a-card>
    <a-modal
      :title="$t('m.AuthorizedByAccessControlOrChannel')"
      :visible="visibleA"
      @ok="handleOkA"
      width="900px"
      @cancel="handleCancelA"
      :footer="null"
      
    >
      <a-steps :current="current">
        <a-step v-for="item in steps" :key="item.title" :title="item.title" />
      </a-steps>
      <div class="steps-content" v-if="current == 0 ? true : false">
        <select-tree-area @checkData="areaSelect" />
        <a-input-search
          :placeholder="$t('m.PleaseEnterYourSearchTerms')"
          style="width: 200px; margin-left: 15px; margin-right: 15px"
          enter-button
          v-model="forminitialC.key"
          @search="onSearchB"
        />
        <a-checkbox @change="onCheckA">
          {{ $t("m.WhetherToDisplayChildNodes") }}
        </a-checkbox>
        <a-transfer
          style="margin-top: 20px"
          :data-source="mockData"
          :locale="{ itemUnit: '项', itemsUnit: '项' }"
          :target-keys="targetKeys"
          :show-search="showSearch"
          :filter-option="
            (inputValue, item) => item.title.indexOf(inputValue) !== -1
          "
          :show-select-all="false"
          
          @change="onChange"
        >
          <template
            slot="children"
            slot-scope="{
              props: { direction, filteredItems, selectedKeys },
              on: { itemSelectAll, itemSelect },
            }"
          >
            <a-table
              :row-selection="
                getRowSelection({
                  selectedKeys,
                  itemSelectAll,
                  itemSelect,
                })
              "
              :columns="direction === 'left' ? leftColumns : rightColumns"
              :data-source="filteredItems"
              bordered
          :pagination="direction === 'left'?ipagination:Rightipagination"
            />
          </template>
        </a-transfer>
      </div>
      <div class="steps-content" v-else>
        <a-table
          class="ant-table-tbody"
          style="margin-top: 20px"
          :columns="columnsB"
          :data-source="dataB"
          :rowKey="(record, i) => record.id"
          bordered
          size="small"
          :pagination="false"
          :scroll="{ x: 3500, y: 500 }"
          :row-selection="{
            onChange: onSelectChangeB,
            selectedRowKeys: selectedRowKeysListB,
          }"
        />
        <a-pagination
          style="margin-top: 10px"
          show-size-changer
          :default-current="1"
          :total="totalB"
          @change="PagesB"
          :pageSizeOptions="['5', '10', '30', '40']"
          @showSizeChange="onShowSizeChangeB"
          class="pages"
        />
      </div>
      <div class="steps-action">
        <a-button
          v-if="current < steps.length - 1"
          type="primary"
          @click="next"
        >
          {{$t('m.Next')}}
        </a-button>
        <a-button
          v-if="current == steps.length - 1"
          type="primary"
          @click="stepOk"
        >
          {{$t('m.Done')}}
        </a-button>
        <a-button v-if="current > 0" style="margin-left: 8px" @click="prev">
          {{$t('m.Previous')}}
        </a-button>
      </div>
    </a-modal>
    <a-modal
      :title="$t('m.ListOfTime')"
      :visible="visibleB"
      :cancelText="$t('m.Cancel')"
      :okText="$t('m.Ok')"
      @ok="handleOkB"
      width="900px"
      @cancel="handleCancelB"
    >
      <a-table
        class="ant-table-tbody"
        style="margin-top: 20px"
        :columns="columnsB"
        :data-source="dataB"
        :rowKey="(record, i) => record.id"
        bordered
        size="small"
        :pagination="false"
        :scroll="{ x: 3500, y: 500 }"
        :row-selection="{
          onChange: onSelectChangeB,
          selectedRowKeys: selectedRowKeysListB,
        }"
      />
    </a-modal>
    <a-drawer
      @close="handleCancel"
      :title="$t('m.SelectPersonnel')"
      :visible="visible"
      placement="right"
      width="800px"
    >
      <a-input-search
        :placeholder="$t('m.PleaseEnterYourSearchTerms')"
        style="width: 200px; margin-right: 15px"
        v-model="forminitialB.key"
        enter-button
        @search="onSearchA"
      />
      <a-button type="primary" icon="plus" @click="addshouquan">{{
        $t("m.TheNewAuthorization")
      }}</a-button>
      <a-table
        style="margin-top: 20px"
        :rowKey="(record, i) => i"
        :columns="ColumnsA"
        :data-source="DataA"
        :pagination="false"
      >
        <div slot="tags" slot-scope="text, tags, i">
          <a
            class="flex-a"
            href="#"
            style="margin-right: 10px"
            @click="editTags(text, tags, i)"
            >{{ $t("m.Modification") }}</a
          >
          <a class="flex-a" href="#" @click="delTags(text, tags, i)"></a>
        </div>
      </a-table>
      <a-pagination
        style="margin-top: 20px"
        show-size-changer
        :default-current="1"
        :total="totalA"
        @change="PagesA"
        :pageSizeOptions="['5', '10', '30', '40']"
        @showSizeChange="onShowSizeChangeA"
        class="pages"
      />
    </a-drawer>
    <Delete ref="del" @confirm="Isok" :dalete="deleteData"></Delete>
  </div>
</template>

<script>
import difference from "lodash/difference";
import Headline from "@/components/Headline";
import SelectTreeArea from "@/components/common/SelectTreeArea";
import { getStaffOrStudInfoList } from "@/api/faceRecognition";
import { getAreaList, getTimeZoneList } from "@/api/perUnit";
import {
  getWidgetDictionaryList,
  getAuthorizeListById,
  getDoorList,
  authForManAndDoor,
  updateAuthForDoorAndMan,
  delAuthForDoorAndMan,
} from "@/api/entrance/cloudDoor";
import { getPerages } from "@/api/keraStase";
import SelectTree from "@/components/common/SelectTree.vue";
import Delete from "@/components/Delete.vue";
export default {
  name: "PeopleAccredit",
  components: { Headline, SelectTreeArea, SelectTree, Delete },
  data() {
    return {
      ipagination:{
        defaultPageSize:5,
        pageSizeOptions:['5','10','20'],
        showSizeChanger:true,
        // showQuickJumper:true,
        onShowSizeChange: this.pageSizeChange,
        onChange: this.pageChange,
        total:0
      },
      Rightipagination:{
         defaultPageSize:5,
      },
      deleteData: {
        titles: this.$t("m.DeleteThePrompt"),
        type: "warning",
        text: this.$t("m.AreYouSureToDeleteThisData"),
      },
      selectedRowKeysListB: [],
      dataB: [],
      steps: [
        {
          title: "First",
          content: "First-content",
        },
        {
          title: "Second",
          content: "Second-content",
        },
      ],
      current: 0,
      DataA: [],
      forminitial: {
        start: 0,
        limit: 10,
        page: 1,
        infoType: 0,
        status: 1,
        key: "",
        property: "-1",
        ymOrgTreeCode: "",
        vChild: false,
      },
      forminitialA: {
        where: "attr1=1",
        groupcode: "SYS0000055",
        insertall: "-1|全部",
      },
      Data: [],
      Columns: [
        { title: this.$t("m.jobnumber"), dataIndex: "stafforstucode" },
        { title: this.$t("m.Name"), dataIndex: "stafforstuname" },
        {
          title: this.$t("m.Sex"),
          dataIndex: "sex",
          customRender: function (text) {
            if (text == "1") {
              return "男";
            } else {
              return "女";
            }
          },
        },
        { title: this.$t("m.coherentUnits"), dataIndex: "orgname" },
        {
          title: this.$t("m.Operation"),
          scopedSlots: { customRender: "show" },
        },
      ],
      selectList: [],
      total: 0,
      visible: false,
      forminitialB: {
        sID: "",
        start: 0,
        page: 1,
        limit: 10,
        key: "",
      },
      ColumnsA: [
        { title: this.$t("m.EquipmentName"), dataIndex: "devname" },
        { title: this.$t("m.deviceNumber"), dataIndex: "id" },
        { title: this.$t("m.ReadHead"), dataIndex: "readhead" },
        { title: this.$t("m.EndTime"), dataIndex: "enddate" },
        { title: this.$t("m.privilegedTime"), dataIndex: "createdate" },
        { title: this.$t("m.SlotName"), dataIndex: "timename" },
        { title: this.$t("m.Slotnumber"), dataIndex: "timeindex" },
        {
          title: this.$t("m.Operation"),
          scopedSlots: { customRender: "tags" },
        },
      ],
      totalA: 0,
      visibleA: false,
      columnsB: [
        {
          title: this.$t("m.Slotnumber"),
          dataIndex: "timeIndex",
        },
        {
          title: this.$t("m.SlotName"),
          dataIndex: "timeName",
        },
        {
          title: this.$t("m.timezone1"),
          children: [
            {
              title: this.$t("m.Start"),
              dataIndex: "startTime",
            },
            {
              title: this.$t("m.End"),
              dataIndex: "endTime",
            },
          ],
        },
        {
          title: this.$t("m.timezone2"),
          children: [
            {
              title: this.$t("m.Start"),
              dataIndex: "startTimeExt1",
            },
            {
              title: this.$t("m.End"),
              dataIndex: "endTimeExt1",
            },
          ],
        },
        {
          title: this.$t("m.timezone3"),
          children: [
            {
              title: this.$t("m.Start"),
              dataIndex: "startTimeExt2",
            },
            {
              title: this.$t("m.End"),
              dataIndex: "endTimeExt12",
            },
          ],
        },
        {
          title: this.$t("m.timezone4"),
          children: [
            {
              title: this.$t("m.Start"),
              dataIndex: "startTimeExt3",
            },
            {
              title: this.$t("m.End"),
              dataIndex: "endTimeExt13",
            },
          ],
        },
        {
          title: this.$t("m.timezone5"),
          children: [
            {
              title: this.$t("m.Start"),
              dataIndex: "startTimeExt4",
            },
            {
              title: this.$t("m.End"),
              dataIndex: "endTimeExt4",
            },
          ],
        },
        {
          title: this.$t("m.timezone6"),
          children: [
            {
              title: this.$t("m.Start"),
              dataIndex: "startTimeExt5",
            },
            {
              title: this.$t("m.End"),
              dataIndex: "endTimeExt5",
            },
          ],
        },
        {
          title: this.$t("m.timezone7"),
          children: [
            {
              title: this.$t("m.Start"),
              dataIndex: "startTimeExt6",
            },
            {
              title: this.$t("m.End"),
              dataIndex: "endTimeExt6",
            },
          ],
        },
        {
          title: this.$t("m.timezone8"),
          children: [
            {
              title: this.$t("m.Start"),
              dataIndex: "startTimeExt7",
            },
            {
              title: this.$t("m.End"),
              dataIndex: "endTimeExt7",
            },
          ],
        },
        {
          title: this.$t("m.timezone9"),
          children: [
            {
              title: this.$t("m.Start"),
              dataIndex: "startTimeExt8",
            },
            {
              title: this.$t("m.End"),
              dataIndex: "endTimeExt8",
            },
          ],
        },
        {
          title: this.$t("m.timezone10"),
          children: [
            {
              title: this.$t("m.Start"),
              dataIndex: "startTimeExt9",
            },
            {
              title: this.$t("m.End"),
              dataIndex: "endTimeExt9",
            },
          ],
        },
        {
          title: this.$t("m.timezone11"),
          children: [
            {
              title: this.$t("m.Start"),
              dataIndex: "startTimeExt10",
            },
            {
              title: this.$t("m.End"),
              dataIndex: "endTimeExt10",
            },
          ],
        },
        {
          title: this.$t("m.weekValue"),
          dataIndex: "weekValue",
          width: 300,
        },
        {
          title: this.$t("m.ValidUntil"),
          dataIndex: "endDate",
        },
      ],
      forminitialC: {
        start: 0,
        limit: 5,
        page: 1,
        areaCode: "001",
        vChild: false,
        key: "",
        // selectedIds:''
      },
      mockData: [],
      targetKeys: [],
      selectedKeys: [],
      showSearch: false,
      disabled: false,
      totalB: 0,
      leftColumns: [
        {
          title: this.$t("m.direction"),
          dataIndex: "inouttype",
          customRender: function (text) {
            if (text == "1") {
              return "进";
            } else {
              return "出";
            }
          },
        },
        { title: this.$t("m.Name"), dataIndex: "name" },
        { title: this.$t("m.deviceNumber"), dataIndex: "machineid" },
        { title: this.$t("m.Controller"), dataIndex: "devname" },
        {
          title: this.$t("m.ReadHead"),
          dataIndex: "readhead",
          customRender: function (text) {
            if (text == "0") {
              return "1号读头";
            } else if (text == "1") {
              return "2号读头";
            } else if (text == "2") {
              return "3号读头";
            } else {
              return "4号读头";
            }
          },
        },
        { title: this.$t("m.SlotName"), dataIndex: "timename" },
        { title: this.$t("m.Slotnumber"), dataIndex: "timeindex" },
      ],
      rightColumns: [
        {
          title: this.$t("m.Name"),
          dataIndex: "devname",
        },
      ],
      forminitialD: {
        jsonData: [],
        sID: "",
        staffOrStuCode: "",
        staffOrStuName: "",
        cardNo: "",
        infoType: "",
        tID: "",
      },
      visibleB: false,
      forminitialE: {
        doorReadHeadId: "",
        timeZoneId: "",
        staffOrStudInfoId: "",
      },
      delIds: "",
    };
  },
  created() {
    getPerages({ params: { orgType: 1 } })
      .then((res) => {
        this.forminitial.ymOrgTreeCode = res.data[0].ymorgtreecode;
        this.discernList();
      })
      .catch((err) => {
        console.log(err);
      });

    this.getWidgetDictionary();
  },
  methods: {
    pageSizeChange(val, pageNum){
      console.log(val, pageNum)
      this.forminitialC.limit = pageNum
      this.forminitialC.page = val
      this.forminitialC.start = pageNum*(val-1)
      this.getDoor()
     
    },
    pageChange(page, val){
      this.forminitialC.page = page
      this.forminitialC.limit = val
      this.forminitialC.start = (page - 1) * val
      this.getDoor()
      console.log(page,val)

    },
    Isok() {
      console.log(this.delIds);
      delAuthForDoorAndMan(this.delIds)
        .then((res) => {
          if (res.data.success == true) {
            this.getAuthorizeListByIdList();
            this.$message.success(res.data.msg);
          }
          if (res.data.success == false) {
            this.$message.error(res.data.msg);
          }
          console.log(res);
        })
        .catch((err) => {
          this.$message.error("操作失败");
          console.log(err);
        });

      this.$refs.del.visible = false;
    },
    delTags(text, tags, i) {
      this.delIds = tags.id;
      this.$refs.del.visible = true;
    },
    handleOkB() {
      if (this.selectedRowKeysListB.length <= 0)
        return this.$message.warning("请勾选时段");
      if (this.selectedRowKeysListB.length > 1)
        return this.$message.warning("只能勾选一个时段");
      this.forminitialE.timeZoneId = this.selectedRowKeysListB[0];
      updateAuthForDoorAndMan(this.forminitialE)
        .then((res) => {
          if (res.data.success == true)
            return this.$message.success(res.data.msg);
          if (res.data.success == false)
            return this.$message.warning(res.data.msg);
          console.log(res);
        })
        .catch((err) => {
          this.$message.error("操作失败");
        });
      this.visibleB = false;
    },
    handleCancelB() {
      this.visibleB = false;
    },
    editTags(text, tags, i) {
      this.getTimeScheme();
      this.forminitialE.staffOrStudInfoId = tags.id;
      this.visibleB = true;
    },
    onShowSizeChangeB(page, limit) {
      this.forminitialC.page = page;
      this.forminitialC.limit = limit;
      this.getTimeScheme();
    },
    PagesB(page, pageSize) {
      this.forminitialC.limit = pageSize;
      this.forminitialC.page = page;
      this.forminitialC.start = (page - 1) * pageSize;
      this.getTimeScheme();
    },
    getTimeScheme() {
      getTimeZoneList({ params: this.forminitialC })
        .then((res) => {
          this.totalB = res.data.total;
          res.data.data.forEach((item) => {
            let weekDayList = [];
            if (item.weekValue) {
              if (JSON.parse(item.weekValue).w0 == 1) {
                weekDayList.push("周日");
              }
              if (JSON.parse(item.weekValue).w1 == 1) {
                weekDayList.push("周一");
              }
              if (JSON.parse(item.weekValue).w2 == 1) {
                weekDayList.push("周二");
              }
              if (JSON.parse(item.weekValue).w3 == 1) {
                weekDayList.push("周三");
              }
              if (JSON.parse(item.weekValue).w4 == 1) {
                weekDayList.push("周四");
              }
              if (JSON.parse(item.weekValue).w5 == 1) {
                weekDayList.push("周五");
              }
              if (JSON.parse(item.weekValue).w6 == 1) {
                weekDayList.push("周六");
              }
              item.weekValue = weekDayList.join(" ");
            }
          });
          this.dataB = res.data.data;
          console.log(res.data.data);
        })
        .catch((err) => {
          console.log(err);
        });
    },
    onSelectChangeB(selectedRowKeys, selectedRows) {
      // this.dataList = selectedRows[0];
      this.selectedRowKeysListB = selectedRowKeys;
      console.log(selectedRows[0]);
      this.forminitialD.tID = selectedRows[0].id;
    },
    next() {
      if (this.targetKeys.length <= 0)
        return this.$message.warning("请选择人员信息");
      this.getTimeScheme();
      let doorReadHeadIdList = [];
      this.targetKeys.forEach((item) => {
        this.mockData.forEach((citem) => {
          if (citem.key == item) {
            doorReadHeadIdList.push(citem);
          }
        });
      });
      console.log(doorReadHeadIdList)
      doorReadHeadIdList = doorReadHeadIdList.map((item) => {
        return {
          devname: item.devname,
          doorreadheadid:parseInt(item.key),
          id: parseInt(item.key),
          infotype: item.infotype,
          machineid: item.machineid,
          name: item.name,
          readhead: item.readhead,
          timeindex: item.timeindex,
          timename: item.timename,
          areaname: "",
        };
      });

      console.log(doorReadHeadIdList)
      this.forminitialD.jsonData = doorReadHeadIdList;
      // console.log(this.forminitialD);
      // console.log(this.mockData);

      this.current++;
    },
    prev() {
      this.current--;
    },
    stepOk() {
      console.log(this.forminitialB.sID);
      if (this.selectedRowKeysListB.length <= 0)
        return this.$message.warning("请勾选时段");
      if (this.selectedRowKeysListB.length > 1)
        return this.$message.warning("只能勾选一个时段");
      // this.mockData.forEach((item) => {
      //   this.targetKeys.forEach((citem) => {
      //     if (item.key == citem) {
      //       this.forminitialD.jsonData[0]["doorreadheadid"] = item.readhead;
      //     }
      //   });SelectPersonnel
      // });
      this.forminitialD.jsonData = JSON.stringify(this.forminitialD.jsonData);

      authForManAndDoor(this.forminitialD)
        .then((res) => {
          if (res.data.success == true) {
            this.$message.success(res.data.msg);
            this.getAuthorizeListByIdList();
          }
          if (res.data.success == false) {
            this.$message.error(res.data.msg);
          }
        })
        .catch((err) => {
          this.$message.error("操作失败");
        });

      this.current = 0;
      this.targetKeys = [];
      this.selectedRowKeysListB = [];
      this.visibleA = false;
    },
    getDoor() {
      getDoorList({ params: this.forminitialC })
        .then((res) => {
          this.ipagination.total = res.data.total
          this.mockData = res.data.data.map((item) => {
            return {
              devname: item.devname,
              inouttype: item.inouttype,
              machineid: item.machineid,
              name: item.name,
              readhead: item.readhead,

              timename: item.timename,
              timeindex: item.timeindex,
              key: item.id + "",
            };
          });
          console.log(res.data);
        })
        .catch((err) => {
          console.log(err);
        });
    },
    onChange(targetKeys, direction, moveKeys) {
      console.log(targetKeys);
      this.targetKeys = targetKeys;
    },

    triggerShowSearch(showSearch) {
      this.showSearch = showSearch;
    },
    getRowSelection({ selectedKeys, itemSelectAll, itemSelect }) {
      return {
        onSelectAll(selected, selectedRows) {
          const treeSelectedKeys = selectedRows
            .filter((item) => !item.disabled)
            .map(({ key }) => key);
          const diffKeys = selected
            ? difference(treeSelectedKeys, selectedKeys)
            : difference(selectedKeys, treeSelectedKeys);
          itemSelectAll(diffKeys, selected);
        },
        onSelect({ key }, selected) {
          // console.log(key)
          itemSelect(key, selected);
        },
        selectedRowKeys: selectedKeys,
      };
    },
    onCheckA(e) {
      this.forminitialC.vChild = e.target.checked;
      this.getDoor();
    },
    onSearchB() {
      this.getDoor();
    },
    areaSelect(e) {
      this.forminitialC.areaCode = e.areacode;
      this.getDoor();
      console.log(e);
    },
    handleOkA() {},
    handleCancelA() {
      this.current = 0;
      this.targetKeys = [];
      this.selectedRowKeysListB = [];
      this.visibleA = false;
    },
    addshouquan() {
      this.getDoor();

      this.visibleA = true;
    },
    onSearchA() {
      this.getAuthorizeListByIdList();
    },
    onShowSizeChangeA(page, limit) {
      this.forminitialB.page = page;
      this.forminitialB.limit = limit;
      this.getAuthorizeListByIdList()();
    },
    PagesA(page, pageSize) {
      this.forminitialB.limit = pageSize;
      this.forminitialB.page = page;
      this.forminitialB.start = (page - 1) * pageSize;
      this.getAuthorizeListByIdList();
    },
    getAuthorizeListByIdList() {
      getAuthorizeListById({ params: this.forminitialB })
        .then((res) => {
          this.totalA = res.data.total;
          this.DataA = res.data.data;
          console.log(res);
        })
        .catch((err) => {
          console.log(err);
        });
    },
    showItem(text, tags, i) {
      this.forminitialB.sID = tags.id;

      this.forminitialE.doorReadHeadId = tags.id;
      this.getAuthorizeListByIdList();
      console.log(tags);
      this.forminitialD.staffOrStuCode = tags.stafforstucode;
      this.forminitialD.staffOrStuName = tags.stafforstuname;
      this.forminitialD.sID = tags.id;
      this.forminitialD.cardNo = tags.cardno;
      this.forminitialD.infoType = tags.infotype;

      this.visible = true;
    },
    handleCancel() {
      this.visible = false;
    },
    onCheck(e) {
      this.forminitial.vChild = e.target.checked;
      this.discernList();
    },
    onSelectChange() {},
    treeChangeA(e) {
      this.forminitial.property = e;
      this.discernList();
      console.log(e);
    },
    getWidgetDictionary() {
      getWidgetDictionaryList({ params: this.forminitialA })
        .then((res) => {
          this.selectList = res.data.data;
          console.log(res);
        })
        .catch((err) => {
          console.log(err);
        });
    },
    onSearch() {
      this.discernList();
    },
    onShowSizeChange(page, limit) {
      this.forminitial.page = page;
      this.forminitial.limit = limit;
      this.discernList()();
    },
    Pages(page, pageSize) {
      this.forminitial.limit = pageSize;
      this.forminitial.page = page;
      this.forminitial.start = (page - 1) * pageSize;
      this.discernList();
    },
    treeChange(e) {
      this.forminitialA.where = "attr1=" + e;
      this.getWidgetDictionary();
      this.forminitial.infoType = e;
      this.discernList();
      console.log(e);
    },
    argumentSelect(data) {
      this.forminitial.ymOrgTreeCode = data.ymorgtreecode;
      this.discernList();
      console.log(data);
    },
    discernList() {
      getStaffOrStudInfoList({ params: this.forminitial })
        .then((res) => {
          this.total = res.data.total;
          this.Data = res.data.data;
          console.log(res.data);
        })
        .catch((err) => {
          console.log(err);
        });
    },
  },
};
</script>

<style>
</style>